/**
 * Created by Administrator on 2017/3/20.
 */
import axios from 'axios'

// axios 公共配置
axios.defaults.timeout = 60000;
if (process.env.NODE_ENV === 'production') {
  // axios.defaults.baseURL = "refuel/api";
  axios.defaults.baseURL = process.env.BASE_URL;
} else {
  axios.defaults.baseURL = "http://192.168.121.135:8887";
}
axios.defaults.withCredentials = true;

// http request 拦截器
axios.interceptors.request.use(
  config => {
    return config;
  },
  err => {
    return Promise.reject(err);
  }
);


// http response 拦截器
axios.interceptors.response.use(
  response => {
    return response;
  },
  error => {
    if (error.response) {

    } else {

    }
    return Promise.reject(error)
  });
export default axios;
